
package com.bdtop.dbl.ui.activities.me;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.util.LruCache;
import android.widget.ImageView;

import com.bdtop.dbl.BaseActivity;
import com.bdtop.dbl.R;
import com.bdtop.dbl.ui.view.TitleBar;
import com.bdtop.dbl.utils.DiskLruCache;

@SuppressLint("SetJavaScriptEnabled")
public class AboutSoftActivity extends BaseActivity {

    private final String url="http://www.hbmat.cn/bdtop/about.jpg";
    
    private ImageView imageAbout;
    public DiskLruCache mDiskLruCache;
    public LruCache<String, Bitmap> mMemoryCache;
    private final static String CACHE_IMG_ABOUT="cache_img_about";
    
    public static final void launch(Context context) {
        Intent intent = new Intent(context, AboutSoftActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_soft);
        
        TitleBar mTitleBar = (TitleBar) findViewById(R.id.title_bar);
        mTitleBar.setTitle(R.string.about_soft);
        mTitleBar.setBelongActivity(this);
        
//        ImageView imgAbout = (ImageView) findViewById(R.id.img_about);
//        Glide.with(this).load(url).crossFade().into(imgAbout);
        
//        mDiskLruCache = CacheUtil.open(this,CACHE_IMG_ABOUT);
//        int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
//        // 使用最大可用内存值的1/8作为缓存的大小。
//        int cacheSize = maxMemory / 8;
//        mMemoryCache = new LruCache<String, Bitmap>(cacheSize) {
//            @Override
//            protected int sizeOf(String key, Bitmap bitmap) {
//                // 重写此方法来衡量每张图片的大小，默认返回图片数量。
//                return bitmap.getByteCount() / 1024;
//            }
//        };
//        
//        /*WebView view = (WebView) findViewById(R.id.web_about);
//        WebSettings wSet = view.getSettings();
//        wSet.setJavaScriptEnabled(true);
//        view.loadUrl(url);*/
//
       
//        
//        imageAbout=(ImageView) findViewById(R.id.img_about);
//        BitmapWorkerTask bitmapWorkerTask=new BitmapWorkerTask(); 
//        bitmapWorkerTask.execute(url,imageAbout,mDiskLruCache,mMemoryCache);
//        
//        /*imageUrl = params[0].toString();
//        imageView= (ImageView) params[1];
//        mDiskLruCache= (DiskLruCache) params[2];
//        mMemoryCache=(LruCache<String, Bitmap>) params[3];*/
    }
}
